package com.bookstore.mapper;

import com.bookstore.entity.Book;
import com.bookstore.entity.BookCar;
import com.bookstore.entity.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author Cofe
 * @Date 2022/5/2 19:08
 */
@Mapper
public interface OrderMapper {
    //添加进订单
    void insertOrder(@Param("bid") int bid, @Param("book_name") String book_name, @Param("book_balance") double book_balance,
                     @Param("user_uid") int user_uid,@Param("book_pic")String book_pic,@Param("buy_id")int buy_id,
                     @Param("book_membalance")double book_membalance,@Param("user_name") String username,
                        @Param("order_address")String address,@Param("order_phone")String phone);
    //查找该用户的所有订单信息"
    List<Order> findorderbyuid(int user_uid);
    //分页查询用户的所有订单信息
    List<Order> selectByPage(@Param("begin") int begin, @Param("size") int size, @Param("username") String username);
    //分页用户所有订单信息
    List<Order> selectOrderAll(@Param("begin") int begin, @Param("size") int size);
    //查询总订单
    Integer selectTotalOrderAll();
    //查询某人总订单数
    Integer selectTotalCountByCondition(String username);
    //删除订单
    Integer deleteOrderById(int buy_id);
    //签收订单
    Integer receiptOrder(int buy_id);
    //查询某人的订单
    List<Order> selectOrderByUser(String username);

}
